[#include "/app/common/layout/__backstagemainlayout.html"/]
[#assign pageJavascript]
<!-- page specific plugin scripts -->
<script src="${ContextPath}/admin/assets/js/jquery.dataTables.js"></script>
<script src="${ContextPath}/admin/assets/js/jquery.dataTables.bootstrap.js"></script>
<script src="${ContextPath}/admin/assets/js/data-tables/dataTables.tableTools.js"></script>
<!-- inline scripts related to this page -->
<script type="text/javascript">

$(".query").click(function(){
	$.ajax({
		type:"post",
		url:"${ContextPath}/admin/notice/query",
		data:{
			"alertinfoid":$(this).attr("alertinfoid"),
		},
		dataType:"json",
		success:function(result){
			$("#queryModal").modal();
			$("#email").attr("value",result.alertinfo.email);
			$("#emailcontext").text(result.alertinfo.emailcontext);
			$("#phone").attr("value",result.alertinfo.phone);
			$("#smscontext").text(result.alertinfo.smscontext);
			$("#smsrecode").attr("value",result.alertinfo.smsrecode);
			$("#created_at").attr("value",result.alertinfo.created_at);
		},
		error:function(){
			alert("error"+$("#orderid").attr("value"));
		}
	});
});
    
$(".delete").click(function(){
	var alertinfoid=$(this).attr("alertinfoid");
	alertModal(alertinfoid);
	$("#alertModal").modal();
	$("#alertinfoid").attr("value",alertinfoid);
});
    
 $("#sure").click(function(){
	$.ajax({
		type:"post",
		url:"${ContextPath}/admin/notice/delete",
		data:{
			"alertinfoid":$("#alertinfoid").attr("value")
		},
		dataType:"json",
		success:function(result){
			if(result.state="删除成功！"){
				alert("删除成功！");
				location.reload();
			}else if(result.state="删除失败！"){
				
			}
		},
		error:function(){
			alert("error"+$("#orderid").attr("value"));
		}
	
	});
});

function alertModal(msg){
	$("#modal-title-order").html("提示!");  
	$("#modal-body-order").html("是否确定删除"+msg+"号记录？");  
}
	
</script>
[/#assign]
[#assign pageCss]
<link rel="stylesheet" href="${ContextPath}/admin/assets/css/data-tables/dataTables.tableTools.css" />
[/#assign]
[@mainlayout pageJavascript=pageJavascript pageCss=pageCss currentMenu="alertinfoFlag-alertinfosListFlag"]

<div class="page-header">
	<h1>
		系统管理
		<small> <i class="ace-icon fa fa-angle-double-right"></i> 通知日志管理</small>
	</h1>
</div>
<div class="hr hr-dotted"></div>

<div class="row">
	<div class="col-xs-12">
		<!-- PAGE CONTENT BEGINS -->
		
		<div class="row">
			<div class="col-xs-12">
				<div class="table-header">通知日志</div>
				<div>
					<table id="orders" class="table table-striped table-bordered table-hover">
						<thead>
							<tr>
								<th width="3%">序号</th>
								<th width="3%">邮箱</th>
								<th width="13%" class="hidden-480">邮件内容</th>
								<th width="3%" class="hidden-480">手机号码</th>
								<th width="6%" class="hidden-480">短信内容</th>
								<th width="4%">状态</th>
								<th width="6%"><i class="ace-icon fa fa-clock-o bigger-110 hidden-480"></i>创建时间</th>
								<th width="6%"></th>
							</tr>
						</thead>
						
						<tbody>
							[#list alertinfoPage.getList() as alertinfo]
							<tr>

								<td width="3%">${alertinfo.id}</td>
								
								<td width="4%">${(alertinfo.email)!}</td>
								<td class="hidden-480" nowrap title="${(alertinfo.emailcontext)!}"><div style="overflow: hidden; width: 200px; height: 20px;">${(alertinfo.emailcontext)!}</div></td>
								<td class="hidden-480">${(alertinfo.phone)!}</td>
								<td class="hidden-480" nowrap title="${(alertinfo.smscontext)!}"><div style="overflow: hidden; width: 300px;">${(alertinfo.smscontext)!}</div></td>

								<td>
									<b>
									[#if (alertinfo.smsrecode)=200]
									<span class="green">正常</span>
									[#else]
									<span class="red">${(alertinfo.smsrecode)!}</span>
									[/#if]
									</b>
								</td>
								<td width="10%">${(alertinfo.created_at)!}</td>

								<td>
									<div class="hidden-sm hidden-xs action-buttons">
										<a class="btn btn-minier btn-primary  blue query" href="#" alertinfoid="${(alertinfo.id)!}"> 查看</a> 
										<a class="btn btn-minier btn-danger red delete" href="#" alertinfoid="${(alertinfo.id)!}"> 删除</a>
									</div>

									<div class="hidden-md hidden-lg">
										<div class="inline position-relative">
											<button class="btn btn-minier btn-yellow dropdown-toggle"
												data-toggle="dropdown" data-position="auto">
												<i class="ace-icon fa fa-caret-down icon-only bigger-120"></i>
											</button>

											<ul
												class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
												<li>
													<a href="#" class="tooltip-info query" data-rel="tooltip"  title="查看" alertinfoid="${(alertinfo.id)!}"> 
														<span class="blue"> 
																<i class="ace-icon fa fa-search-plus bigger-120"></i>
														</span>
													</a>
												</li>

												<li>
													<a href="#" class="tooltip-error delete" data-rel="tooltip" title="删除" alertinfoid="${(alertinfo.id)!}"> 
														<span class="red">
															<i class="ace-icon fa fa-trash-o bigger-120"></i>
														</span>
													</a>
												</li>
											</ul>
										</div>
									</div>
								</td>
							</tr>
							[/#list]
						</tbody>
					</table>
					[#include "/app/common/inc/_paginate.html" /]
					[@paginate currentPage=alertinfoPage.pageNumber totalPage=alertinfoPage.totalPage actionUrl="/admin/notice/" /]
				</div>
			</div>
		</div>
		<!-- PAGE CONTENT ENDS -->
	</div>
	<!-- /.col -->
</div>
[#include "/app/admin/notice/_model.html" /]
[/@mainlayout]